//
//  AppDelegate.m
//  团团赚
//
//  Created by 曾飞 on 16/10/26.
//  Copyright © 2016年 artron. All rights reserved.
//

#import "AppDelegate.h"
#import "LoginPage.h"
#import "FxGlobal.h"
#import "HomePage.h"



@interface AppDelegate ()

@end

@implementation AppDelegate

+ (AppDelegate *)appDeg
{
    return  (AppDelegate *)[UIApplication sharedApplication].delegate;
}

- (void)showHomePage
{
    HomePage *page = [[HomePage alloc] init];
    
    self.window.rootViewController = page;
    
    [self.window makeKeyAndVisible];
}

- (void)showLoginPage
{
    LoginPage *page = [[LoginPage alloc] init];
    
    self.window.rootViewController = page;
    
    [self.window makeKeyAndVisible];
    
  
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
    if ([FxGlobal global].userInfo != nil) {
        [self showHomePage];
    }
    else {
        [self showLoginPage];
    }
    
    
   return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
   }

- (void)applicationDidEnterBackground:(UIApplication *)application {
   
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
  }

- (void)applicationDidBecomeActive:(UIApplication *)application {
  }

- (void)applicationWillTerminate:(UIApplication *)application {
  }

@end
